//
//  IKSmallFileStorage.h
//  MeeLive
//
//  Created by guangling.hou on 14/12/17.
//  Copyright (c) 2014年 Meelive. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef enum : NSUInteger {
    SMALL_STORAGE_STATUS_ALL,
    SMALL_STORAGE_STATUS_PART
} ME_SMALL_STORAGE_STATUS;

@protocol IKSmallFileStorageDelegate<NSObject>

@optional
- (void)didFinishWithSongUrl:(NSString *)url;
- (void)didFinishWithError:(ME_SMALL_STORAGE_STATUS)stat;
- (void)taskDownPrgressValue:(float)value;

@end

typedef enum : NSUInteger { SMALL_TYPE, LARGE_TYPE } DownLoadFileType;

@interface IKSmallFileStorage : NSObject {
}

@property(nonatomic, copy) NSString *path;
@property(nonatomic, copy) NSString *songTempUrl;
@property(nonatomic, weak) id<IKSmallFileStorageDelegate> delegate;

/**
 * 初始化
 * @param dirName 存储文件夹名称
 */
- (id)initWithKey:(NSString *)dirName;

- (NSString *)directoryPath;

// 同步接口
- (void)asyncDownload:(NSArray *)urlArray;

// 获取进度 0 - 100;
- (NSInteger)getProgress;

- (BOOL)isNotSyncing;

- (NSString *)localFilePathForUrl:(NSString *)url;

- (NSData *)dataForUrl:(NSString *)url;

// 主动获取进度
- (float)singleFileProgress:(NSString *)url;

@end
